Optimal. Leaf size=284 \[ \frac {2 b^3 \tan ^{-1}\left (\frac {b+a \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {a^2-b^2}}\right )}{\sqrt {a^2-b^2} (b c-a d)^3 f}+\frac {d \left (6 a b c^3 d-a^2 d^2 \left (2 c^2+d^2\right )-b^2 \left (6 c^4-5 c^2 d^2+2 d^4\right )\right ) \tan ^{-1}\left (\frac {d+c \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {c^2-d^2}}\right )}{(b c-a d)^3 \left (c^2-d^2\right )^{5/2} f}-\frac {d^2 \cos (e+f x)}{2 (b c-a d) \left (c^2-d^2\right ) f (c+d \sin (e+f x))^2}-\frac {d^2 \left (5 b c^2-3 a c d-2 b d^2\right ) \cos (e+f x)}{2 (b c-a d)^2 \left (c^2-d^2\right )^2 f (c+d \sin (e+f x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.73, antiderivative size = 284, normalized size of antiderivative = 1.00, number of steps
used = 9, number of rules used = 6, integrand size = 25, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.240, Rules used = {2881, 3134,
3080, 2739, 632, 210} \begin {gather*} \frac {d \left (-a^2 d^2 \left (2 c^2+d^2\right )+6 a b c^3 d-b^2 \left (6 c^4-5 c^2 d^2+2 d^4\right )\right ) \text {ArcTan}\left (\frac {c \tan \left (\frac {1}{2} (e+f x)\right )+d}{\sqrt {c^2-d^2}}\right )}{f \left (c^2-d^2\right )^{5/2} (b c-a d)^3}+\frac {2 b^3 \text {ArcTan}\left (\frac {a \tan \left (\frac {1}{2} (e+f x)\right )+b}{\sqrt {a^2-b^2}}\right )}{f \sqrt {a^2-b^2} (b c-a d)^3}-\frac {d^2 \left (-3 a c d+5 b c^2-2 b d^2\right ) \cos (e+f x)}{2 f \left (c^2-d^2\right )^2 (b c-a d)^2 (c+d \sin (e+f x))}-\frac {d^2 \cos (e+f x)}{2 f \left (c^2-d^2\right ) (b c-a d) (c+d \sin (e+f x))^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 210
Rule 632
Rule 2739
Rule 2881
Rule 3080
Rule 3134
Rubi steps
\begin {align*} \int \frac {1}{(a+b \sin (e+f x)) (c+d \sin (e+f x))^3} \, dx &=-\frac {d^2 \cos (e+f x)}{2 (b c-a d) \left (c^2-d^2\right ) f (c+d \sin (e+f x))^2}+\frac {\int \frac {-2 \left (a c d-b \left (c^2-d^2\right )\right )-d (2 b c-a d) \sin (e+f x)+b d^2 \sin ^2(e+f x)}{(a+b \sin (e+f x)) (c+d \sin (e+f x))^2} \, dx}{2 (b c-a d) \left (c^2-d^2\right )}\\ &=-\frac {d^2 \cos (e+f x)}{2 (b c-a d) \left (c^2-d^2\right ) f (c+d \sin (e+f x))^2}-\frac {d^2 \left (5 b c^2-3 a c d-2 b d^2\right ) \cos (e+f x)}{2 (b c-a d)^2 \left (c^2-d^2\right )^2 f (c+d \sin (e+f x))}+\frac {\int \frac {2 b^2 \left (c^2-d^2\right )^2-a b c d \left (4 c^2-d^2\right )+a^2 d^2 \left (2 c^2+d^2\right )-b d \left (4 b c^3-2 a c^2 d-b c d^2-a d^3\right ) \sin (e+f x)}{(a+b \sin (e+f x)) (c+d \sin (e+f x))} \, dx}{2 (b c-a d)^2 \left (c^2-d^2\right )^2}\\ &=-\frac {d^2 \cos (e+f x)}{2 (b c-a d) \left (c^2-d^2\right ) f (c+d \sin (e+f x))^2}-\frac {d^2 \left (5 b c^2-3 a c d-2 b d^2\right ) \cos (e+f x)}{2 (b c-a d)^2 \left (c^2-d^2\right )^2 f (c+d \sin (e+f x))}+\frac {b^3 \int \frac {1}{a+b \sin (e+f x)} \, dx}{(b c-a d)^3}+\frac {\left (d \left (6 a b c^3 d-a^2 d^2 \left (2 c^2+d^2\right )-b^2 \left (6 c^4-5 c^2 d^2+2 d^4\right )\right )\right ) \int \frac {1}{c+d \sin (e+f x)} \, dx}{2 (b c-a d)^3 \left (c^2-d^2\right )^2}\\ &=-\frac {d^2 \cos (e+f x)}{2 (b c-a d) \left (c^2-d^2\right ) f (c+d \sin (e+f x))^2}-\frac {d^2 \left (5 b c^2-3 a c d-2 b d^2\right ) \cos (e+f x)}{2 (b c-a d)^2 \left (c^2-d^2\right )^2 f (c+d \sin (e+f x))}+\frac {\left (2 b^3\right ) \text {Subst}\left (\int \frac {1}{a+2 b x+a x^2} \, dx,x,\tan \left (\frac {1}{2} (e+f x)\right )\right )}{(b c-a d)^3 f}+\frac {\left (d \left (6 a b c^3 d-a^2 d^2 \left (2 c^2+d^2\right )-b^2 \left (6 c^4-5 c^2 d^2+2 d^4\right )\right )\right ) \text {Subst}\left (\int \frac {1}{c+2 d x+c x^2} \, dx,x,\tan \left (\frac {1}{2} (e+f x)\right )\right )}{(b c-a d)^3 \left (c^2-d^2\right )^2 f}\\ &=-\frac {d^2 \cos (e+f x)}{2 (b c-a d) \left (c^2-d^2\right ) f (c+d \sin (e+f x))^2}-\frac {d^2 \left (5 b c^2-3 a c d-2 b d^2\right ) \cos (e+f x)}{2 (b c-a d)^2 \left (c^2-d^2\right )^2 f (c+d \sin (e+f x))}-\frac {\left (4 b^3\right ) \text {Subst}\left (\int \frac {1}{-4 \left (a^2-b^2\right )-x^2} \, dx,x,2 b+2 a \tan \left (\frac {1}{2} (e+f x)\right )\right )}{(b c-a d)^3 f}-\frac {\left (2 d \left (6 a b c^3 d-a^2 d^2 \left (2 c^2+d^2\right )-b^2 \left (6 c^4-5 c^2 d^2+2 d^4\right )\right )\right ) \text {Subst}\left (\int \frac {1}{-4 \left (c^2-d^2\right )-x^2} \, dx,x,2 d+2 c \tan \left (\frac {1}{2} (e+f x)\right )\right )}{(b c-a d)^3 \left (c^2-d^2\right )^2 f}\\ &=\frac {2 b^3 \tan ^{-1}\left (\frac {b+a \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {a^2-b^2}}\right )}{\sqrt {a^2-b^2} (b c-a d)^3 f}+\frac {d \left (6 a b c^3 d-a^2 d^2 \left (2 c^2+d^2\right )-b^2 \left (6 c^4-5 c^2 d^2+2 d^4\right )\right ) \tan ^{-1}\left (\frac {d+c \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {c^2-d^2}}\right )}{(b c-a d)^3 \left (c^2-d^2\right )^{5/2} f}-\frac {d^2 \cos (e+f x)}{2 (b c-a d) \left (c^2-d^2\right ) f (c+d \sin (e+f x))^2}-\frac {d^2 \left (5 b c^2-3 a c d-2 b d^2\right ) \cos (e+f x)}{2 (b c-a d)^2 \left (c^2-d^2\right )^2 f (c+d \sin (e+f x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 2.38, size = 263, normalized size = 0.93 \begin {gather*} \frac {\frac {4 b^3 \tan ^{-1}\left (\frac {b+a \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {a^2-b^2}}\right )}{\sqrt {a^2-b^2}}-\frac {2 d \left (-6 a b c^3 d+a^2 d^2 \left (2 c^2+d^2\right )+b^2 \left (6 c^4-5 c^2 d^2+2 d^4\right )\right ) \tan ^{-1}\left (\frac {d+c \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {c^2-d^2}}\right )}{\left (c^2-d^2\right )^{5/2}}-\frac {d^2 (b c-a d)^2 \cos (e+f x)}{(c-d) (c+d) (c+d \sin (e+f x))^2}+\frac {d^2 (b c-a d) \left (-5 b c^2+3 a c d+2 b d^2\right ) \cos (e+f x)}{(c-d)^2 (c+d)^2 (c+d \sin (e+f x))}}{2 (b c-a d)^3 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(624\) vs.
\(2(270)=540\).
time = 3.65, size = 625, normalized size = 2.20
method | result | size |
derivativedivides | \(\frac {\frac {2 d \left (\frac {\frac {d^{2} \left (5 a^{2} c^{2} d^{2}-2 a^{2} d^{4}-12 a b \,c^{3} d +6 a b c \,d^{3}+7 b^{2} c^{4}-4 b^{2} c^{2} d^{2}\right ) \left (\tan ^{3}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{2 \left (c^{4}-2 c^{2} d^{2}+d^{4}\right ) c}+\frac {d \left (4 a^{2} c^{4} d^{2}+7 a^{2} c^{2} d^{4}-2 a^{2} d^{6}-10 a b \,c^{5} d -16 a b \,c^{3} d^{3}+8 a b c \,d^{5}+6 b^{2} c^{6}+9 b^{2} c^{4} d^{2}-6 b^{2} c^{2} d^{4}\right ) \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{2 \left (c^{4}-2 c^{2} d^{2}+d^{4}\right ) c^{2}}+\frac {d^{2} \left (11 a^{2} c^{2} d^{2}-2 a^{2} d^{4}-28 a b \,c^{3} d +10 a b c \,d^{3}+17 b^{2} c^{4}-8 b^{2} c^{2} d^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{2 \left (c^{4}-2 c^{2} d^{2}+d^{4}\right ) c}+\frac {d \left (4 a^{2} c^{2} d^{2}-a^{2} d^{4}-10 a b \,c^{3} d +4 a b c \,d^{3}+6 b^{2} c^{4}-3 b^{2} c^{2} d^{2}\right )}{2 c^{4}-4 c^{2} d^{2}+2 d^{4}}}{\left (c \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )+2 d \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+c \right )^{2}}+\frac {\left (2 a^{2} c^{2} d^{2}+a^{2} d^{4}-6 a b \,c^{3} d +6 b^{2} c^{4}-5 b^{2} c^{2} d^{2}+2 b^{2} d^{4}\right ) \arctan \left (\frac {2 c \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+2 d}{2 \sqrt {c^{2}-d^{2}}}\right )}{2 \left (c^{4}-2 c^{2} d^{2}+d^{4}\right ) \sqrt {c^{2}-d^{2}}}\right )}{\left (a d -b c \right )^{3}}-\frac {2 b^{3} \arctan \left (\frac {2 a \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+2 b}{2 \sqrt {a^{2}-b^{2}}}\right )}{\left (a^{3} d^{3}-3 a^{2} b c \,d^{2}+3 a \,b^{2} c^{2} d -b^{3} c^{3}\right ) \sqrt {a^{2}-b^{2}}}}{f}\) | \(625\) |
default | \(\frac {\frac {2 d \left (\frac {\frac {d^{2} \left (5 a^{2} c^{2} d^{2}-2 a^{2} d^{4}-12 a b \,c^{3} d +6 a b c \,d^{3}+7 b^{2} c^{4}-4 b^{2} c^{2} d^{2}\right ) \left (\tan ^{3}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{2 \left (c^{4}-2 c^{2} d^{2}+d^{4}\right ) c}+\frac {d \left (4 a^{2} c^{4} d^{2}+7 a^{2} c^{2} d^{4}-2 a^{2} d^{6}-10 a b \,c^{5} d -16 a b \,c^{3} d^{3}+8 a b c \,d^{5}+6 b^{2} c^{6}+9 b^{2} c^{4} d^{2}-6 b^{2} c^{2} d^{4}\right ) \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{2 \left (c^{4}-2 c^{2} d^{2}+d^{4}\right ) c^{2}}+\frac {d^{2} \left (11 a^{2} c^{2} d^{2}-2 a^{2} d^{4}-28 a b \,c^{3} d +10 a b c \,d^{3}+17 b^{2} c^{4}-8 b^{2} c^{2} d^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{2 \left (c^{4}-2 c^{2} d^{2}+d^{4}\right ) c}+\frac {d \left (4 a^{2} c^{2} d^{2}-a^{2} d^{4}-10 a b \,c^{3} d +4 a b c \,d^{3}+6 b^{2} c^{4}-3 b^{2} c^{2} d^{2}\right )}{2 c^{4}-4 c^{2} d^{2}+2 d^{4}}}{\left (c \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )+2 d \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+c \right )^{2}}+\frac {\left (2 a^{2} c^{2} d^{2}+a^{2} d^{4}-6 a b \,c^{3} d +6 b^{2} c^{4}-5 b^{2} c^{2} d^{2}+2 b^{2} d^{4}\right ) \arctan \left (\frac {2 c \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+2 d}{2 \sqrt {c^{2}-d^{2}}}\right )}{2 \left (c^{4}-2 c^{2} d^{2}+d^{4}\right ) \sqrt {c^{2}-d^{2}}}\right )}{\left (a d -b c \right )^{3}}-\frac {2 b^{3} \arctan \left (\frac {2 a \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+2 b}{2 \sqrt {a^{2}-b^{2}}}\right )}{\left (a^{3} d^{3}-3 a^{2} b c \,d^{2}+3 a \,b^{2} c^{2} d -b^{3} c^{3}\right ) \sqrt {a^{2}-b^{2}}}}{f}\) | \(625\) |
risch | \(\text {Expression too large to display}\) | \(1603\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 786 vs.
\(2 (276) = 552\).
time = 0.49, size = 786, normalized size = 2.77 \begin {gather*} \frac {\frac {2 \, {\left (\pi \left \lfloor \frac {f x + e}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (a\right ) + \arctan \left (\frac {a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + b}{\sqrt {a^{2} - b^{2}}}\right )\right )} b^{3}}{{\left (b^{3} c^{3} - 3 \, a b^{2} c^{2} d + 3 \, a^{2} b c d^{2} - a^{3} d^{3}\right )} \sqrt {a^{2} - b^{2}}} - \frac {{\left (6 \, b^{2} c^{4} d - 6 \, a b c^{3} d^{2} + 2 \, a^{2} c^{2} d^{3} - 5 \, b^{2} c^{2} d^{3} + a^{2} d^{5} + 2 \, b^{2} d^{5}\right )} {\left (\pi \left \lfloor \frac {f x + e}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (c\right ) + \arctan \left (\frac {c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + d}{\sqrt {c^{2} - d^{2}}}\right )\right )}}{{\left (b^{3} c^{7} - 3 \, a b^{2} c^{6} d + 3 \, a^{2} b c^{5} d^{2} - 2 \, b^{3} c^{5} d^{2} - a^{3} c^{4} d^{3} + 6 \, a b^{2} c^{4} d^{3} - 6 \, a^{2} b c^{3} d^{4} + b^{3} c^{3} d^{4} + 2 \, a^{3} c^{2} d^{5} - 3 \, a b^{2} c^{2} d^{5} + 3 \, a^{2} b c d^{6} - a^{3} d^{7}\right )} \sqrt {c^{2} - d^{2}}} - \frac {7 \, b c^{4} d^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 5 \, a c^{3} d^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 4 \, b c^{2} d^{5} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + 2 \, a c d^{6} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + 6 \, b c^{5} d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 4 \, a c^{4} d^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 9 \, b c^{3} d^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 7 \, a c^{2} d^{5} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 6 \, b c d^{6} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 2 \, a d^{7} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 17 \, b c^{4} d^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 11 \, a c^{3} d^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 8 \, b c^{2} d^{5} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 2 \, a c d^{6} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 6 \, b c^{5} d^{2} - 4 \, a c^{4} d^{3} - 3 \, b c^{3} d^{4} + a c^{2} d^{5}}{{\left (b^{2} c^{8} - 2 \, a b c^{7} d + a^{2} c^{6} d^{2} - 2 \, b^{2} c^{6} d^{2} + 4 \, a b c^{5} d^{3} - 2 \, a^{2} c^{4} d^{4} + b^{2} c^{4} d^{4} - 2 \, a b c^{3} d^{5} + a^{2} c^{2} d^{6}\right )} {\left (c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 2 \, d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + c\right )}^{2}}}{f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 30.30, size = 2500, normalized size = 8.80 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________